package org.bao.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.bao.bean.phoneBean;
import org.bao.dao.phoneDao;
import org.bao.service.IPhoneMsg;
import org.springframework.stereotype.Service;

@Service("proS")
public class PhoneMsg implements IPhoneMsg {

	// 依赖注入【反转控制】
	// 面向接口的编程
	@Resource
	private phoneDao proD; // 按类型匹配进行注入

	/**
	 * 查询所有未删除商品的信息
	 */
	@Override
	public List<phoneBean> selectAllInfos() {
		// 调用Dao层进行业务逻辑查询
		List<phoneBean> lstPros = proD.selectAllInfos();
		// 返回结果
		return lstPros;
	}

	@Override
	public List<phoneBean> selectIdInfo(Integer phoneid) {

		List<phoneBean> lisphone = proD.selectIdInfos(phoneid);
		System.out.println("商品信息:" + lisphone);
		return lisphone;
	}
	
	@Override
	public List<phoneBean> selectIdListInfo(String phoneid) {

		List<phoneBean> lisphone = proD.selectIdListInfos(phoneid);
		System.out.println("多组商品信息:" + lisphone);
		return lisphone;
	}
}
